package com.cloud.lan.api;

import com.cloud.lan.api.dto.req.BaseReq;
import com.cloud.lan.api.dto.req.LanActivityReq;
import com.cloud.lan.entity.base.BaseResponse;
import com.cloud.lan.service.ILanActivityService;

import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import lombok.extern.slf4j.Slf4j;

/**
 * 兑换券入口
 * @author ErKang
 * @date Created in 2021/12/5 04:24
 * @title TestApi.java
 * Department: Product development
 */
@Slf4j
@RestController
@RequestMapping(value = {"/v1/activity/"}, method = {RequestMethod.GET, RequestMethod.POST}, consumes = {"*/*"}, produces = {"application/json"})
public class LanActivityApi {

    @Resource
    ILanActivityService lanActivityService;

    @RequestMapping("getActivityList")
    public BaseResponse<Object> getActivityList(@RequestHeader(BaseReq.ut) String token, String lng, String lat) {
        return lanActivityService.getActivityList(token, lng, lat);
    }

    @RequestMapping("getActivityUsers")
    public BaseResponse<Object> getActivityUsers(@RequestHeader(BaseReq.ut) String token, Integer status) {
        return lanActivityService.getActivityUsers(token, status);
    }

    @RequestMapping("userReceive")
    public BaseResponse<Object> userReceive(@RequestHeader(BaseReq.ut) String token, @RequestBody LanActivityReq req) {
        return lanActivityService.userReceive(token, req);
    }

    @RequestMapping("userApply")
    public BaseResponse<Object> userApply(@RequestHeader(BaseReq.ut) String token, @RequestBody LanActivityReq req) {
        return lanActivityService.userApply(token, req);
    }
}
